home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue31 / webcomm / SHOP1.TXT < prev    next >
Encoding:
Text File  |  1998-01-15  |  4.7 KB  |  145 lines

  1. <h1>-Macros</h1>
  2. mcPartsLogo=<img src=/htdemo/shop1/parts.gif Alt="Parts! Store">
  3.  
  4. <h1>-Page:homepage=,,,Welcome to the WebHub Shopping Demo</h1>
  5. %=mcPartsLogo=%
  6. <p>
  7. Parts! Parts! Get your parts here!<BR>
  8. Big parts. Small parts. Parts for just about everything.<P>
  9. Don't think you need anything? 
  10. Browse through our extensive list of parts 
  11. and we bet you'll find something
  12. you didn't know you needed.<P>
  13.  
  14. <p>
  15. <FORM METHOD=POST ACTION="%=ACTION|poster=%">
  16. %=webdatagrid1.execute=%
  17. %=chButtons=%
  18. </FORM>
  19.  
  20. <h1>-Chunk:chButtons</h1>
  21. <INPUT TYPE=SUBMIT  NAME=BtnShop VALUE="First Page">
  22. <INPUT TYPE=SUBMIT  NAME=BtnShop VALUE="Prior Page">
  23. <INPUT TYPE=SUBMIT  NAME=BtnShop VALUE="Next Page">
  24. <INPUT TYPE=SUBMIT  NAME=BtnShop VALUE="Last Page">
  25. <INPUT TYPE=SUBMIT  NAME=BtnShop VALUE="Go to Checkout">
  26.  
  27. <h1>-Page:poster=,,,Internal page for posting</h1>
  28. %=WebActionPostLit.execute=%
  29. %=Match|BtnShop~Go to Checkout|%=Page|Confirm=%=%
  30. %=waScrollGrid.execute=%
  31. %=PAGE|homepage=%
  32.  
  33. <h1>-Page:confirm=,,,Confirm Your Order of Parts!</h1>
  34. // expire unconditionally so Back button forces reload ex site
  35. %=EXPIRES|-1=%
  36.  
  37.  
  38.  
  39. %=mcPartsLogo=%
  40. <h2>%=pagedesc=%</h2>
  41. <B>You have ordered the following items:</B><BR>
  42. %=webactionOrderList.execute=%
  43. <p>
  44.  
  45. %=ASSIGNED|CardProblem|%=chProblem=%=%
  46. <FORM METHOD=POST ACTION="%=ACTION|CheckCard=%">
  47. <h3>Bill to:</h3>
  48. <TABLE>
  49.  <TR><TD>Cardholder's Name:</TD>
  50.      <TD><INPUT TYPE=TEXT NAME="CardHolderName"                   VALUE="%=CardHolderName=%">
  51.      </TD></TR>
  52.  <TR><TD>Card Number:</TD>
  53.      <TD><INPUT TYPE=TEXT NAME="WebCreditCard1.CardNumber"
  54.  VALUE="%=WebCreditCard1.CardNumber=%">
  55.      </TD></TR>
  56.  <TR><TD>Expiry (MM/YY):</TD>
  57.      <TD><INPUT TYPE=TEXT NAME="WebCreditCard1.ExpirationDate" VALUE="%=WebCreditCard1.ExpirationDate=%">
  58.      </TD></TR>
  59. </TABLE>
  60.  
  61.  
  62. %=chCompleteAddress=%
  63. <INPUT TYPE="SUBMIT" VALUE="Continue">   
  64. </FORM>
  65.  
  66. <h1>-Chunk:chCompleteAddress</h1>
  67. <h3>Ship to</h3>
  68. <TABLE>
  69. <TR><TD>Your Name:</TD>
  70. <TD><INPUT TYPE=TEXT NAME="CustFullname" VALUE="%=CustFullName=%"></TD></TR>
  71. <TR><TD>Your EMail:</TD>
  72. <TD><INPUT TYPE=TEXT NAME="CustEMail" VALUE="%=CustEMail=%"></TD></TR>
  73. <TR><TD>City:</TD>
  74. <TD><INPUT TYPE=TEXT NAME="CustCity" VALUE="%=CustCity=%"></TD></TR>
  75. </table>
  76.  
  77. <h1>-Page:CheckCard</h1>
  78. // check for valid card, bounce back if invalid:
  79. %=WebCreditCard1.Execute=%
  80. // if we get here, the credit card details are valid, at least
  81. %=WebactionQueueTransaction.execute=%
  82. // they've been queued for online authorisation, so clear them...
  83. %=WebCreditCard1.Execute|CLEAR=%
  84. // now move on...
  85. %=Page|TransQueue=%
  86.  
  87. <h1>-Page:TransQueue=,,,Transaction Queued</h1>
  88. // special for security in case of Back button!
  89.  
  90. // Check up-to-date status:
  91. %=WebactionQueueTransaction.execute|CHECK=%
  92.  
  93. // bounce away if we have a non-queued result
  94. %=MATCH|TransStatus!Accepted|%=Page|Thx=%=%
  95. %=NOMATCH|TransStatus!Queued|%=Page|TransProblem=%=%
  96.  
  97. // Discard page header, replace it with our own (due to Meta Refresh requirement)
  98. %=Flush|=%
  99. <HTML><HEAD>
  100.  
  101. <TITLE>%=PageDesc=%</TITLE>
  102. // refresh back to this page every 20 seconds
  103. <META HTTP-EQUIV="Refresh" CONTENT="20; URL=%=where=%">
  104. </HEAD>
  105.  
  106. <BODY  bgcolor="#FFFFFF">
  107. %=mcPartsLogo=%
  108. <H2>Your credit card transaction is being processed.</H2>
  109. <P>Current status is: <B>%=TransStatus=%</B>
  110.  
  111. <P>%=Jump|TransQueue|Check current status=%
  112.  
  113. <h1>-Page:TransProblem=,,,Sorry, there was a problem with your payment</h1>
  114. <H2>Sorry, there was a payment problem</H2>
  115. <P>We were unable to confirm acceptance of your order.
  116. <P>The status returned was: <B>%=TransStatus=%</B>.
  117.  
  118. <P>If you wish, you can %=Jump|Confirm|enter payment details again.=%
  119.  
  120. <h1>-Page:thx=,,,Thank You</h1>
  121. // send message with sale information to the site owner
  122. %=webactionMailer.execute=%
  123.  
  124. %=mcPartsLogo=%
  125. <h2>Thanks, %=CustFullname=%, your payment has been processed.</h2>
  126. <B>Your parts will be sent to:</B><br>
  127. %=custCity=%<P>
  128.  
  129. <b>If we have any problems with your order, we will contact you at:</B><br>
  130. %=custEmail=%
  131.  
  132. <P>By the way, if you need a complete, well-tested, generic but sophisticated shopping cart application which logs transactions to a database, the full-source WebHub shopping cart application at http://www.href.com/shopcart/  is a bargain at $US219. It can be readily configured for any store's catalog, and also supports "mall-style" collections of shops running on a single server.
  133.  
  134. <h1>-Chunk:chProblem</h1>
  135.  
  136. <P>There was a problem with the information you entered รป please check it and try again:<BR>
  137. <UL>
  138.  
  139. %=NOTASSIGNED|CardHolderName|<LI>Cardholder's Name is required! =%
  140.  
  141. %=MATCH|WebCreditCard1.CardName!Invalid|<LI>Invalid Card Number=%
  142.  
  143. %=MATCH|WebCreditCard1.ExpirationError=Expired|<LI>Card has expired! =%
  144. </UL><P>
  145.